package models;

import java.util.Date;
import java.util.LinkedList;

import javax.persistence.Entity;
import javax.persistence.Lob;

import play.db.jpa.Model;

@Entity

public class User extends Model {
	
	public String name;
	public String address;
	public String homePhone;
	//public String role;
	//public String role_description;
	public boolean isAdmin ;
	public String username;
	public String password;
	public Date dateOfBirth;
	
	
	@Lob
	public LinkedList<String> email;
	
	@Lob
	public LinkedList<String> mobilePhone;

	public User(String username, String password) {
		
		this.username = username;
		this.password = password;
		
	}

	public static boolean connect(String username, String password) {
		
		return User.find("username = ? and password = ?", username,password).first() != null;
	
	}
	
}
